package com.portal4kids.view;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.portal4kids.controller.TravelManager;
import com.portal4kids.model.Travel;

public class TravelAction extends ActionSupport{
	private Travel travel;
	private TravelManager travelController;
	private List<Travel> travelList = new ArrayList<Travel>();
	
	
	public TravelAction() {
		travelController = new TravelManager();
	}

	public String execute(){
		return SUCCESS;		
	}
	
	public String addTravel(){
		travel = travelController.save(getTravel());
		return SUCCESS;		
	}
	
	public String showTravel(){
		travelList = travelController.getTravelFromDB(getTravel().getAdress(), getTravel().getAttribute());
		return SUCCESS;		
	}

	public Travel getTravel() {
		return travel;
	}

	public void setTravel(Travel travel) {
		this.travel = travel;
	}

	public List<Travel> getTravelList() {
		return travelList;
	}

	public void setTravelList(List<Travel> travelList) {
		this.travelList = travelList;
	}
	
	
	
	
	

}
